Telegram Group & Telegram Channel
Даны следующие таблицы:

Customers

| CustomerID |   Name   |     City      |
|------------|----------|---------------|
| 1 | John | New York |
| 2 | Jane | Chicago |
| 3 | Mark | Los Angeles |
| 4 | Sarah | San Francisco |
| 5 | Michael | Houston |

Orders

| OrderID | CustomerID | OrderDate | TotalAmount |
|---------|------------|------------|-------------|
| 1 | 1 | 2022-05-15 | 500 |
| 2 | 2 | 2022-06-20 | 750 |
| 3 | 3 | 2022-06-25 | 1000 |
| 4 | 1 | 2022-07-10 | 300 |
| 5 | 4 | 2022-08-05 | 900 |

Какой из следующих SQL запросов вернет имена покупателей, разместивших как минимум 2 заказа?

A) SELECT Name FROM Customers WHERE CustomerID IN (SELECT CustomerID FROM Orders GROUP BY CustomerID HAVING COUNT(*) >= 2)

B) SELECT Name FROM Customers JOIN Orders ON Customers.CustomerID = Orders.CustomerID GROUP BY Customers.CustomerID HAVING COUNT(*) >= 2

C) SELECT Name FROM Customers JOIN Orders ON Customers.CustomerID = Orders.CustomerID WHERE COUNT(*) >= 2

D) SELECT Name FROM Customers WHERE CustomerID IN (SELECT CustomerID FROM Orders WHERE COUNT(*) >= 2)



tg-me.com/sql_for_qa/113
Create:
Last Update:

Даны следующие таблицы:

Customers

| CustomerID |   Name   |     City      |
|------------|----------|---------------|
| 1 | John | New York |
| 2 | Jane | Chicago |
| 3 | Mark | Los Angeles |
| 4 | Sarah | San Francisco |
| 5 | Michael | Houston |

Orders

| OrderID | CustomerID | OrderDate | TotalAmount |
|---------|------------|------------|-------------|
| 1 | 1 | 2022-05-15 | 500 |
| 2 | 2 | 2022-06-20 | 750 |
| 3 | 3 | 2022-06-25 | 1000 |
| 4 | 1 | 2022-07-10 | 300 |
| 5 | 4 | 2022-08-05 | 900 |

Какой из следующих SQL запросов вернет имена покупателей, разместивших как минимум 2 заказа?

A) SELECT Name FROM Customers WHERE CustomerID IN (SELECT CustomerID FROM Orders GROUP BY CustomerID HAVING COUNT(*) >= 2)

B) SELECT Name FROM Customers JOIN Orders ON Customers.CustomerID = Orders.CustomerID GROUP BY Customers.CustomerID HAVING COUNT(*) >= 2

C) SELECT Name FROM Customers JOIN Orders ON Customers.CustomerID = Orders.CustomerID WHERE COUNT(*) >= 2

D) SELECT Name FROM Customers WHERE CustomerID IN (SELECT CustomerID FROM Orders WHERE COUNT(*) >= 2)

BY SQL для тестировщика


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/sql_for_qa/113

View MORE
Open in Telegram


SQL для тестировщика Telegram | DID YOU KNOW?

Date: |

Find Channels On Telegram?

Telegram is an aspiring new messaging app that’s taking the world by storm. The app is free, fast, and claims to be one of the safest messengers around. It allows people to connect easily, without any boundaries.You can use channels on Telegram, which are similar to Facebook pages. If you’re wondering how to find channels on Telegram, you’re in the right place. Keep reading and you’ll find out how. Also, you’ll learn more about channels, creating channels yourself, and the difference between private and public Telegram channels.

How to Use Bitcoin?

n the U.S. people generally use Bitcoin as an alternative investment, helping diversify a portfolio apart from stocks and bonds. You can also use Bitcoin to make purchases, but the number of vendors that accept the cryptocurrency is still limited. Big companies that accept Bitcoin include Overstock, AT&T and Twitch. You may also find that some small local retailers or certain websites take Bitcoin, but you’ll have to do some digging. That said, PayPal has announced that it will enable cryptocurrency as a funding source for purchases this year, financing purchases by automatically converting crypto holdings to fiat currency for users. “They have 346 million users and they’re connected to 26 million merchants,” says Spencer Montgomery, founder of Uinta Crypto Consulting. “It’s huge.”

SQL для тестировщика from ru


Telegram SQL для тестировщика
FROM USA